﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Collections;

namespace SwiftMVVM.ValueConverters
{
    /// <summary>
    /// The MultiValueConverter takes a collection of bindings and returns them as an
    /// array of objects. This conversion is one way only.
    /// </summary>
    public sealed class MultiValueConverter : IMultiValueConverter
    {
        public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            //We need to make a copy of the values otherwise they'll be all null
            //when the reciever gets them
            var returnValues = new ArrayList();
            if (values != null)
            {
                returnValues.AddRange(values);
            }
            return returnValues.ToArray();
        }
        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
